package com.toncen.samepms.fisher.filter;

import java.util.ArrayList;
import java.util.List;
import com.toncen.samepms.fisher.condition.InformationEqulasCondition;
import com.toncen.samepms.fisher.condition.InformationLikeCondition;
import com.toncen.samepms.fisher.condition.InformationNotEqulasCondition;
import com.toncen.samepms.fisher.condition.InformationNotLikeCondition;
import com.toncen.samepms.fisher.condition.RoleLikeCondtion;
import com.toncen.samepms.net.dao.ChannelDao;
import com.toncen.samepms.net.domain.Channel;
import com.sky.fisher.condition.AbstractCondition;
import com.sky.fisher.filter.AbstractColumnFilter;
import com.sky.fisher.filter.Options;
import com.sky.fisher.model.CommonColumnModel;

public class InformationColumnFilter extends AbstractColumnFilter{
	private AbstractCondition[] conditons = new AbstractCondition[] { new InformationEqulasCondition(), new InformationLikeCondition(), 
			new InformationNotLikeCondition(), new InformationNotEqulasCondition()};

	/**
	 * 
	 */
	public InformationColumnFilter() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sky.fisher.filter.AbstractColumnFilter#getConditons()
	 */
	@Override
	protected AbstractCondition[] getConditons() {
		return conditons;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sky.fisher.filter.AbstractColumnFilter#getValueOptions(com.sky.fisher.model.CommonColumnModel)
	 */
	public List<Options> getValueOptions(CommonColumnModel column) throws Exception {
		List<Options> valueOptions = new ArrayList<Options>();
		ChannelDao channelDao = new ChannelDao();
		List<Channel> channels = channelDao.getAllByState(1);
		for (Channel channel : channels) {
			valueOptions.add(new Options(channel.getName(), channel.getName()));
		}
		return valueOptions;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.sky.fisher.filter.AbstractColumnFilter#getDefaultCondition()
	 */
	@Override
	public AbstractCondition getDefaultCondition() {
		return new RoleLikeCondtion();
	}

	@Override
	public String getValidateMessage() {
		return null;
	}

	@Override
	public String getValidatePattern() {
		return null;
	}
}
